---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
      name:  <unnamed>
       log:  G:\Shared drives\NDRL_IACHR_Acuerdos\Paper\Article\ISQ\Replication\ndrl_agreements.log
  log type:  text
 opened on:  19 Oct 2023, 10:33:54

. 
.  use "ndrl_agreements", clear
(NDRL: CIDH Recommendation-years, 2021-08-28)

.  
. *** Descriptives ***
.    ** Table 1. Compliance Agreements Reported by the IACHR
.  preserve 

.   sort case 

.   collapse (max) agreement (last) state agreement_yr victims, by(case) 

.      sort agreement_yr

.      list state agreement_yr victims  if agreement == 1, noobs noheader clean compress
    Chile          2003   Carmelo Soria Espinoza                                                                                                                                                                                                               
>                                               
    Guatemala      2005   Extrajudicial Executions: Pedro García Chuc                                                                                                                                                                                          
>                                               
    Guatemala      2005   María Eugenia Morales de Sierra                                                                                                                                                                                                      
>                                               
    Guatemala      2005   Martín Pelicó Coxic                                                                                                                                                                                                                  
>                                               
    Guatemala      2007   Ileana del Rosario Solares Castillo, María Ana López Rodríguez and Luz Leticia Hernández                                                                                                                                             
>                                               
    Nicaragua      2007   Milton García Fajardo and others                                                                                                                                                                                                     
>                                               
    El Salvador    2007   Jorge Odir Miranda Cortez et al.                                                                                                                                                                                                     
>                                               
    Paraguay       2009   Victor Hugo Maciel                                                                                                                                                                                                                   
>                                               
    Ecuador        2010   Rafael Ignacio Cuesta Caputi                                                                                                                                                                                                         
>                                               
    Mexico         2012   J.S.C.H and M.G.S                                                                                                                                                                                                                    
>                                               
    Argentina      2013   Adriana Gallo, Ana María Careaga, Silvia Maluf                                                                                                                                                                                       
>                                               
    Mexico         2013   Paloma Angelica Escobar Ledezma et al.                                                                                                                                                                                               
>                                               
    Chile          2015   Miguel Ángel Millar Silva, Narciso Nahuelquín Lepío, Patricia Cocq, Luis Jerez, Carolina Leyton, Soledad Lorca, Vanesa Mancisidor, Marcia Paredes, Alejandra Venegas, Genaro Barría, Eduardo Carimoney, Mabel Chiguay Carimoney, Rodr
> igo Levicoy, Palmenia Saldivia, Marcos Silva  
    Colombia       2015   Valentín Basto Calderón, Pedro Vicente Camargo and Carmenza Camargo Sepúlveda                                                                                                                                                        
>                                               
    Ecuador        2017   Jorge Darwin García and family                                                                                                                                                                                                       
>                                               
    Colombia       2017   Marta Lucia Alvarez Giraldo                                                                                                                                                                                                          
>                                               

.   * Percentage of cases with agreements
.     tab agreement

      (max) |
  agreement |      Freq.     Percent        Cum.
------------+-----------------------------------
          0 |         99       86.09       86.09
          1 |         16       13.91      100.00
------------+-----------------------------------
      Total |        115      100.00

.  restore

. 
.  ** Discussion of the dataset
.   * Percentage of observations "treated" by compliance agreements
.    tab postagree if y_any!=.

  Agreement |
    adopted |      Freq.     Percent        Cum.
------------+-----------------------------------
          0 |      4,354       91.47       91.47
          1 |        406        8.53      100.00
------------+-----------------------------------
      Total |      4,760      100.00

.   * Types of measures recommended by the Commission 
.   preserve 

.    sort repcode

.    decode rtype_cm, generate(rtype_)

.    collapse (max) agreement y_full y_part (last) rtype_, by(repcode)

.    * Types of recommendations
.     tab rtype_

  (last) rtype_ |      Freq.     Percent        Cum.
----------------+-----------------------------------
   Compensation |        108       21.91       21.91
 Non-Repetition |        220       44.62       66.53
    Restoration |         52       10.55       77.08
   Satisfaction |         16        3.25       80.32
Truth & Justice |         97       19.68      100.00
----------------+-----------------------------------
          Total |        493      100.00

.   restore

. 
.  ** For recommendation-years
.   * Proportion of treated recommendation-years
.     tab postagree

  Agreement |
    adopted |      Freq.     Percent        Cum.
------------+-----------------------------------
          0 |      4,354       91.47       91.47
          1 |        406        8.53      100.00
------------+-----------------------------------
      Total |      4,760      100.00

.      
. *** Analisis ***
.  ** 1 ** Propensity Score Matching
.  
.    use "ndrl_agreements", clear
(NDRL: CIDH Recommendation-years, 2021-08-28)

.    *drop if y_any==. // already dropped
.    
.   * Create and label state dummies: cow_1 through cow_22
.   tabulate cowcode, generate(cow_)

                       cowcode |      Freq.     Percent        Cum.
-------------------------------+-----------------------------------
                 United States |        960       20.17       20.17
                        Canada |         42        0.88       21.05
                       Bahamas |        314        6.60       27.65
                          Cuba |        119        2.50       30.15
                         Haiti |         76        1.60       31.74
                       Jamaica |        344        7.23       38.97
           Trinidad and Tobago |         45        0.95       39.92
                       Grenada |        161        3.38       43.30
                        Mexico |        253        5.32       48.61
                        Belize |         52        1.09       49.71
                     Guatemala |        405        8.51       58.21
                   El Salvador |         23        0.48       58.70
                     Nicaragua |         38        0.80       59.50
                      Colombia |        339        7.12       66.62
                        Guyana |         98        2.06       68.68
                       Ecuador |        105        2.21       70.88
                          Peru |        179        3.76       74.64
                        Brazil |        824       17.31       91.95
                      Paraguay |        115        2.42       94.37
                         Chile |        190        3.99       98.36
                     Argentina |         52        1.09       99.45
                       Uruguay |         26        0.55      100.00
-------------------------------+-----------------------------------
                         Total |      4,760      100.00

.   foreach var of varlist * {
  2.   local varlabel : var label `var'
  3.   local newname : subinstr local varlabel "cowcode==" "", all
  4.   label variable `var' "`newname'"
  5.   }

.   * Create and label reparation type dummies: rty_1 through rty_5
.   tabulate rtype_cm, generate(rty_)

Type of measure |      Freq.     Percent        Cum.
----------------+-----------------------------------
    Restoration |        396        8.32        8.32
   Satisfaction |         86        1.81       10.13
 Non-Repetition |      2,015       42.33       52.46
Truth & Justice |      1,243       26.11       78.57
   Compensation |      1,020       21.43      100.00
----------------+-----------------------------------
          Total |      4,760      100.00

.   foreach var of varlist * {
  2.   local varlabel : var label `var'
  3.   local newname : subinstr local varlabel "rtype_cm==" "", all
  4.   label variable `var' "`newname'"
  5.   }

.   drop rty_1 // referece category

. 
.   * Model 3.1. Treatment: IPW 
.   psweight ipw postagree rty_*      art51pub c.t##c.t##c.t##c.t cow_*     

note: cow_1 != 0 predicts failure perfectly;
      cow_1 omitted and 960 obs not used.

note: cow_2 != 0 predicts failure perfectly;
      cow_2 omitted and 42 obs not used.

note: cow_3 != 0 predicts failure perfectly;
      cow_3 omitted and 314 obs not used.

note: cow_4 != 0 predicts failure perfectly;
      cow_4 omitted and 119 obs not used.

note: cow_5 != 0 predicts failure perfectly;
      cow_5 omitted and 76 obs not used.

note: cow_6 != 0 predicts failure perfectly;
      cow_6 omitted and 344 obs not used.

note: cow_7 != 0 predicts failure perfectly;
      cow_7 omitted and 45 obs not used.

note: cow_8 != 0 predicts failure perfectly;
      cow_8 omitted and 161 obs not used.

note: cow_10 != 0 predicts failure perfectly;
      cow_10 omitted and 52 obs not used.

note: cow_15 != 0 predicts failure perfectly;
      cow_15 omitted and 98 obs not used.

note: cow_17 != 0 predicts failure perfectly;
      cow_17 omitted and 179 obs not used.

note: cow_18 != 0 predicts failure perfectly;
      cow_18 omitted and 824 obs not used.

note: cow_22 != 0 predicts failure perfectly;
      cow_22 omitted and 26 obs not used.

note: cow_21 omitted because of collinearity.


Initial:      f(p) = -1053.5837
Alternative:  f(p) = -923.59702
Rescale:      f(p) = -882.15777
Iteration 0:  f(p) = -882.15777  
Iteration 1:  f(p) = -713.19522  
Iteration 2:  f(p) = -695.75909  
Iteration 3:  f(p) = -695.24897  
Iteration 4:  f(p) = -695.24872  
Iteration 5:  f(p) = -695.24872  

Propensity score model coefficients                Number of obs  =      1,520
Propensity score reweigting
Loss = IPW
---------------------------------------------------------------------------------
      postagree | Coefficient
----------------+----------------------------------------------------------------
          rty_2 |  -.8011953
          rty_3 |   .1760606
          rty_4 |  -.8486554
          rty_5 |  -1.928283
       art51pub |    .172079
              t |   1.379066
                |
        c.t#c.t |  -.2001684
                |
    c.t#c.t#c.t |   .0114817
                |
c.t#c.t#c.t#c.t |  -.0002321
                |
          cow_1 |          0  (omitted)
          cow_2 |          0  (omitted)
          cow_3 |          0  (omitted)
          cow_4 |          0  (omitted)
          cow_5 |          0  (omitted)
          cow_6 |          0  (omitted)
          cow_7 |          0  (omitted)
          cow_8 |          0  (omitted)
          cow_9 |  -1.217635
         cow_10 |          0  (omitted)
         cow_11 |  -.7616086
         cow_12 |   .5813288
         cow_13 |   1.257909
         cow_14 |  -1.507292
         cow_15 |          0  (omitted)
         cow_16 |  -.7459782
         cow_17 |          0  (omitted)
         cow_18 |          0  (omitted)
         cow_19 |  -1.841439
         cow_20 |   .0226543
         cow_21 |          0  (omitted)
         cow_22 |          0  (omitted)
          _cons |  -2.087952
---------------------------------------------------------------------------------
New variables created: _weight _weight_mtch _pscore _treated 
  

.   * Table 2: Balance table
.   dmout rty_* art51pub t cow_* using balance1                    , by(postagree) list csv replace

    v1                           v2       v3          v4  
    Variable                      0        1        Diff  
    --------------------..                                
    Satisfaction               0.02     0.02       0.002  
                             [0.00]   [0.01]     [0.007]  
    Non-Repetition             0.43     0.38     -0.045*  
                             [0.01]   [0.02]     [0.026]  
    Truth & Justice            0.25     0.39    0.137***  
                             [0.01]   [0.02]     [0.023]  
    Compensation               0.22     0.15   -0.073***  
                             [0.01]   [0.02]     [0.021]  
    Published                  0.82     0.87     0.050**  
                             [0.01]   [0.02]     [0.020]  
    Years since report (..     6.40     8.16    1.764***  
                             [0.08]   [0.25]     [0.274]  
    United States              0.22     0.00   -0.220***  
                             [0.01]   [0.00]     [0.021]  
    Canada                     0.01     0.00    -0.010**  
                             [0.00]   [0.00]     [0.005]  
    Bahamas                    0.07     0.00   -0.072***  
                             [0.00]   [0.00]     [0.013]  
    Cuba                       0.03     0.00   -0.027***  
                             [0.00]   [0.00]     [0.008]  
    Haiti                      0.02     0.00   -0.017***  
                             [0.00]   [0.00]     [0.007]  
    Jamaica                    0.08     0.00   -0.079***  
                             [0.00]   [0.00]     [0.013]  
    Trinidad and Tobago        0.01     0.00    -0.010**  
                             [0.00]   [0.00]     [0.005]  
    Grenada                    0.04     0.00   -0.037***  
                             [0.00]   [0.00]     [0.009]  
    Mexico                     0.04     0.14    0.098***  
                             [0.00]   [0.02]     [0.012]  
    Belize                     0.01     0.00    -0.012**  
                             [0.00]   [0.00]     [0.005]  
    Guatemala                  0.06     0.31    0.244***  
                             [0.00]   [0.02]     [0.014]  
    El Salvador                0.00     0.04    0.035***  
                             [0.00]   [0.01]     [0.004]  
    Nicaragua                  0.00     0.06    0.056***  
                             [0.00]   [0.01]     [0.005]  
    Colombia                   0.07     0.12    0.049***  
                             [0.00]   [0.02]     [0.013]  
    Guyana                     0.02     0.00   -0.023***  
                             [0.00]   [0.00]     [0.007]  
    Ecuador                    0.02     0.07    0.049***  
                             [0.00]   [0.01]     [0.008]  
    Peru                       0.04     0.00   -0.041***  
                             [0.00]   [0.00]     [0.010]  
    Brazil                     0.19     0.00   -0.189***  
                             [0.01]   [0.00]     [0.019]  
    Paraguay                   0.02     0.03       0.009  
                             [0.00]   [0.01]     [0.008]  
    Chile                      0.03     0.18    0.156***  
                             [0.00]   [0.02]     [0.010]  
    Argentina                  0.01     0.06    0.050***  
                             [0.00]   [0.01]     [0.005]  
    Uruguay                    0.01     0.00      -0.006  
                             [0.00]   [0.00]     [0.004]  
    N                          4354      406        4760  
    --------------------..                                
    Significance levels:..                                
    Standard errors in p..                                

.   dmout rty_* art51pub t cow_* using balance2 [iweight = _weight], by(postagree) list csv replace

    v1                           v2       v3         v4  
    Variable                      0        1       Diff  
    --------------------..                               
    Satisfaction               0.03     0.04      0.016  
                             [0.00]   [0.01]    [0.010]  
    Non-Repetition             0.25     0.25     -0.003  
                             [0.01]   [0.02]    [0.025]  
    Truth & Justice            0.38     0.37     -0.014  
                             [0.01]   [0.02]    [0.028]  
    Compensation               0.30     0.29     -0.012  
                             [0.01]   [0.02]    [0.027]  
    Published                  0.73     0.67   -0.058**  
                             [0.01]   [0.02]    [0.026]  
    Years since report (..     6.72     6.44     -0.276  
                             [0.17]   [0.26]    [0.323]  
    United States              0.00     0.00      0.000  
                             [0.00]   [0.00]    [0.000]  
    Canada                     0.00     0.00      0.000  
                             [0.00]   [0.00]    [0.000]  
    Bahamas                    0.00     0.00      0.000  
                             [0.00]   [0.00]    [0.000]  
    Cuba                       0.00     0.00      0.000  
                             [0.00]   [0.00]    [0.000]  
    Haiti                      0.00     0.00      0.000  
                             [0.00]   [0.00]    [0.000]  
    Jamaica                    0.00     0.00      0.000  
                             [0.00]   [0.00]    [0.000]  
    Trinidad and Tobago        0.00     0.00      0.000  
                             [0.00]   [0.00]    [0.000]  
    Grenada                    0.00     0.00      0.000  
                             [0.00]   [0.00]    [0.000]  
    Mexico                     0.16     0.12    -0.039*  
                             [0.01]   [0.02]    [0.021]  
    Belize                     0.00     0.00      0.000  
                             [0.00]   [0.00]    [0.000]  
    Guatemala                  0.26     0.22     -0.038  
                             [0.01]   [0.02]    [0.025]  
    El Salvador                0.01     0.01      0.003  
                             [0.00]   [0.01]    [0.006]  
    Nicaragua                  0.03     0.02     -0.003  
                             [0.00]   [0.01]    [0.009]  
    Colombia                   0.22     0.30   0.083***  
                             [0.01]   [0.02]    [0.025]  
    Guyana                     0.00     0.00      0.000  
                             [0.00]   [0.00]    [0.000]  
    Ecuador                    0.08     0.10      0.022  
                             [0.01]   [0.01]    [0.016]  
    Peru                       0.00     0.00      0.000  
                             [0.00]   [0.00]    [0.000]  
    Brazil                     0.00     0.00      0.000  
                             [0.00]   [0.00]    [0.000]  
    Paraguay                   0.08     0.06     -0.012  
                             [0.01]   [0.01]    [0.015]  
    Chile                      0.14     0.13     -0.013  
                             [0.01]   [0.02]    [0.020]  
    Argentina                  0.03     0.03     -0.002  
                             [0.01]   [0.01]    [0.010]  
    Uruguay                    0.00     0.00      0.000  
                             [0.00]   [0.00]    [0.000]  
    N                          1114      406       1520  
    --------------------..                               
    Significance levels:..                               
    Standard errors in p..                               

.   
.   * Estimate effects with and without matching
.   reg y_any postagree

      Source |       SS           df       MS      Number of obs   =     4,760
-------------+----------------------------------   F(1, 4758)      =     23.02
       Model |  1.21324377         1  1.21324377   Prob > F        =    0.0000
    Residual |  250.810076     4,758  .052713341   R-squared       =    0.0048
-------------+----------------------------------   Adj R-squared   =    0.0046
       Total |  252.023319     4,759  .052957201   Root MSE        =    .22959

------------------------------------------------------------------------------
       y_any | Coefficient  Std. err.      t    P>|t|     [95% conf. interval]
-------------+----------------------------------------------------------------
   postagree |   .0571571    .011914     4.80   0.000     .0338002     .080514
       _cons |   .0512173   .0034795    14.72   0.000     .0443959    .0580387
------------------------------------------------------------------------------

.   reg y_any postagree [iweight = _weight]

      Source |       SS           df       MS      Number of obs   =     1,520
-------------+----------------------------------   F(1, 1518)      =     17.30
       Model |  1.25833795         1  1.25833795   Prob > F        =    0.0000
    Residual |  110.414656     1,518  .072736927   R-squared       =    0.0113
-------------+----------------------------------   Adj R-squared   =    0.0106
       Total |  111.672994     1,519  .073517441   Root MSE        =     .2697

------------------------------------------------------------------------------
       y_any | Coefficient  Std. err.      t    P>|t|     [95% conf. interval]
-------------+----------------------------------------------------------------
   postagree |   .0650302   .0156348     4.16   0.000      .034362    .0956984
       _cons |   .0624743   .0080804     7.73   0.000     .0466243    .0783243
------------------------------------------------------------------------------

.   
.   * Table 3 - IPW and Selection
.   * Model 3.1. Treatment: IPW 
.   logit            postagree i.rtype_cm art51pub c.t##c.t##c.t##c.t cow_*    // PSW model

note: cow_1 != 0 predicts failure perfectly;
      cow_1 omitted and 960 obs not used.

note: cow_2 != 0 predicts failure perfectly;
      cow_2 omitted and 42 obs not used.

note: cow_3 != 0 predicts failure perfectly;
      cow_3 omitted and 314 obs not used.

note: cow_4 != 0 predicts failure perfectly;
      cow_4 omitted and 119 obs not used.

note: cow_5 != 0 predicts failure perfectly;
      cow_5 omitted and 76 obs not used.

note: cow_6 != 0 predicts failure perfectly;
      cow_6 omitted and 344 obs not used.

note: cow_7 != 0 predicts failure perfectly;
      cow_7 omitted and 45 obs not used.

note: cow_8 != 0 predicts failure perfectly;
      cow_8 omitted and 161 obs not used.

note: cow_10 != 0 predicts failure perfectly;
      cow_10 omitted and 52 obs not used.

note: cow_15 != 0 predicts failure perfectly;
      cow_15 omitted and 98 obs not used.

note: cow_17 != 0 predicts failure perfectly;
      cow_17 omitted and 179 obs not used.

note: cow_18 != 0 predicts failure perfectly;
      cow_18 omitted and 824 obs not used.

note: cow_22 != 0 predicts failure perfectly;
      cow_22 omitted and 26 obs not used.

note: cow_21 omitted because of collinearity.
Iteration 0:  Log likelihood = -882.14471  
Iteration 1:  Log likelihood = -713.25076  
Iteration 2:  Log likelihood = -695.78339  
Iteration 3:  Log likelihood = -695.25021  
Iteration 4:  Log likelihood = -695.24872  
Iteration 5:  Log likelihood = -695.24872  

Logistic regression                                     Number of obs =  1,520
                                                        LR chi2(17)   = 373.79
                                                        Prob > chi2   = 0.0000
Log likelihood = -695.24872                             Pseudo R2     = 0.2119

----------------------------------------------------------------------------------
       postagree | Coefficient  Std. err.      z    P>|z|     [95% conf. interval]
-----------------+----------------------------------------------------------------
        rtype_cm |
   Satisfaction  |  -.8011953   .5701367    -1.41   0.160    -1.918643    .3162521
 Non-Repetition  |   .1760606   .3556684     0.50   0.621    -.5210366    .8731579
Truth & Justice  |  -.8486554   .3564904    -2.38   0.017    -1.547364   -.1499469
   Compensation  |  -1.928283     .37517    -5.14   0.000    -2.663603   -1.192964
                 |
        art51pub |    .172079   .2267222     0.76   0.448    -.2722883    .6164463
               t |   1.379066   .2053951     6.71   0.000      .976499    1.781633
                 |
         c.t#c.t |  -.2001684   .0383762    -5.22   0.000    -.2753843   -.1249525
                 |
     c.t#c.t#c.t |   .0114817   .0027295     4.21   0.000     .0061319    .0168314
                 |
 c.t#c.t#c.t#c.t |  -.0002321   .0000645    -3.60   0.000    -.0003585   -.0001056
                 |
           cow_1 |          0  (omitted)
           cow_2 |          0  (omitted)
           cow_3 |          0  (omitted)
           cow_4 |          0  (omitted)
           cow_5 |          0  (omitted)
           cow_6 |          0  (omitted)
           cow_7 |          0  (omitted)
           cow_8 |          0  (omitted)
           cow_9 |  -1.217635   .4123231    -2.95   0.003    -2.025773   -.4094964
          cow_10 |          0  (omitted)
          cow_11 |  -.7616086   .4210747    -1.81   0.070      -1.5869    .0636828
          cow_12 |   .5813288   .6841095     0.85   0.395    -.7595013    1.922159
          cow_13 |   1.257909   .5509568     2.28   0.022     .1780539    2.337765
          cow_14 |  -1.507292   .4296484    -3.51   0.000    -2.349388   -.6651966
          cow_15 |          0  (omitted)
          cow_16 |  -.7459782   .4633508    -1.61   0.107    -1.654129    .1621727
          cow_17 |          0  (omitted)
          cow_18 |          0  (omitted)
          cow_19 |  -1.841439   .5105286    -3.61   0.000    -2.842056   -.8408209
          cow_20 |   .0226543   .4312476     0.05   0.958    -.8225754    .8678841
          cow_21 |          0  (omitted)
          cow_22 |          0  (omitted)
           _cons |  -2.087952   .4578343    -4.56   0.000     -2.98529   -1.190613
----------------------------------------------------------------------------------

.    est store M31

.   * Model 3.2. Outcome with Inverse Propensity Weight Matching
.   mecloglog y_any i.postagree i.rtype_cm art51pub c.t##c.t##c.t##c.t              [iweight = _weight] || case: , startvalues(zero)       

Fitting fixed-effects model:

Iteration 0:  Log likelihood = -436.57395  
Iteration 1:  Log likelihood = -384.22163  
Iteration 2:  Log likelihood = -382.16951  
Iteration 3:  Log likelihood = -382.14387  
Iteration 4:  Log likelihood = -382.14377  
Iteration 5:  Log likelihood = -382.14377  

Refining starting values:

Grid node 0:  Log likelihood =          .
Grid node 1:  Log likelihood = -789.29087
Grid node 2:  Log likelihood = -484.83712
Grid node 3:  Log likelihood = -427.24078

Fitting full model:

Iteration 0:  Log likelihood = -427.24078  (not concave)
Iteration 1:  Log likelihood = -394.91648  (not concave)
Iteration 2:  Log likelihood = -379.35863  (not concave)
Iteration 3:  Log likelihood = -368.50996  
Iteration 4:  Log likelihood = -357.63814  
Iteration 5:  Log likelihood = -356.49862  
Iteration 6:  Log likelihood = -356.39861  
Iteration 7:  Log likelihood = -356.39864  

Mixed-effects cloglog regression                Number of obs     =      1,520
Group variable: case                            Number of groups  =         43

                                                Obs per group:
                                                              min =          2
                                                              avg =       35.3
                                                              max =        111

Integration method: mvaghermite                 Integration pts.  =          7

                                                Wald chi2(10)     =      54.94
Log likelihood = -356.39864                     Prob > chi2       =     0.0000
----------------------------------------------------------------------------------
           y_any | Coefficient  Std. err.      z    P>|z|     [95% conf. interval]
-----------------+----------------------------------------------------------------
     1.postagree |   1.213319   .3512845     3.45   0.001     .5248144    1.901824
                 |
        rtype_cm |
   Satisfaction  |  -1.497569   .6643423    -2.25   0.024    -2.799656   -.1954819
 Non-Repetition  |  -1.594966   .4792749    -3.33   0.001    -2.534327   -.6556042
Truth & Justice  |  -3.079633   .5567588    -5.53   0.000     -4.17086   -1.988406
   Compensation  |  -1.166347   .4747547    -2.46   0.014    -2.096849   -.2358451
                 |
        art51pub |   .7890975   .3519014     2.24   0.025     .0993834    1.478812
               t |  -.0697058   .2504451    -0.28   0.781    -.5605692    .4211576
                 |
         c.t#c.t |   .0190577   .0551235     0.35   0.730    -.0889823    .1270977
                 |
     c.t#c.t#c.t |  -.0012973    .004506    -0.29   0.773    -.0101289    .0075342
                 |
 c.t#c.t#c.t#c.t |   .0000221   .0001188     0.19   0.852    -.0002108    .0002551
                 |
           _cons |  -1.745578   .5190195    -3.36   0.001    -2.762837   -.7283182
-----------------+----------------------------------------------------------------
case             |
       var(_cons)|   1.743625   .6677744                      .8231131    3.693573
----------------------------------------------------------------------------------
LR test vs. cloglog model: chibar2(01) = 51.49        Prob >= chibar2 = 0.0000

.    est store M32

.   * Model 3.3 After 2002         
.   mecloglog y_any i.postagree i.rtype_cm art51pub c.t##c.t##c.t##c.t if period==1 [iweight = _weight] || case: , startvalues(zero)

Fitting fixed-effects model:

Iteration 0:  Log likelihood = -410.82664  
Iteration 1:  Log likelihood = -364.78861  
Iteration 2:  Log likelihood = -363.19504  
Iteration 3:  Log likelihood = -363.17363  
Iteration 4:  Log likelihood = -363.17352  
Iteration 5:  Log likelihood = -363.17352  

Refining starting values:

Grid node 0:  Log likelihood =          .
Grid node 1:  Log likelihood = -736.80799
Grid node 2:  Log likelihood = -465.17698
Grid node 3:  Log likelihood = -414.62242

Fitting full model:

Iteration 0:  Log likelihood = -414.62242  (not concave)
Iteration 1:  Log likelihood = -381.72796  (not concave)
Iteration 2:  Log likelihood = -356.12032  
Iteration 3:  Log likelihood = -347.66093  
Iteration 4:  Log likelihood =  -344.8972  
Iteration 5:  Log likelihood = -344.60377  
Iteration 6:  Log likelihood = -344.60314  
Iteration 7:  Log likelihood = -344.60315  

Mixed-effects cloglog regression                Number of obs     =      1,327
Group variable: case                            Number of groups  =         43

                                                Obs per group:
                                                              min =          2
                                                              avg =       30.9
                                                              max =         81

Integration method: mvaghermite                 Integration pts.  =          7

                                                Wald chi2(10)     =      56.31
Log likelihood = -344.60315                     Prob > chi2       =     0.0000
----------------------------------------------------------------------------------
           y_any | Coefficient  Std. err.      z    P>|z|     [95% conf. interval]
-----------------+----------------------------------------------------------------
     1.postagree |   1.067334   .3344066     3.19   0.001     .4119089    1.722758
                 |
        rtype_cm |
   Satisfaction  |   -1.38217   .6456206    -2.14   0.032    -2.647563   -.1167771
 Non-Repetition  |  -1.506474    .466097    -3.23   0.001    -2.420008   -.5929412
Truth & Justice  |  -2.848061   .5460458    -5.22   0.000    -3.918291    -1.77783
   Compensation  |  -.9933589   .4600417    -2.16   0.031    -1.895024   -.0916938
                 |
        art51pub |   1.053603   .3674399     2.87   0.004     .3334339    1.773772
               t |  -.2274476    .263134    -0.86   0.387    -.7431807    .2882856
                 |
         c.t#c.t |   .0226806   .0571893     0.40   0.692    -.0894084    .1347695
                 |
     c.t#c.t#c.t |  -.0006584   .0047223    -0.14   0.889    -.0099138    .0085971
                 |
 c.t#c.t#c.t#c.t |  -5.08e-06   .0001264    -0.04   0.968    -.0002528    .0002426
                 |
           _cons |  -1.425775   .4993269    -2.86   0.004    -2.404437   -.4471118
-----------------+----------------------------------------------------------------
case             |
       var(_cons)|   1.301541   .5392644                      .5778057    2.931799
----------------------------------------------------------------------------------
LR test vs. cloglog model: chibar2(01) = 37.14        Prob >= chibar2 = 0.0000

.     est store M33

.   * Model 3.4 Unmatched sample  
.   mecloglog y_any i.postagree i.rtype_cm art51pub c.t##c.t##c.t##c.t                                  || case: , startvalues(zero)

Fitting fixed-effects model:

Iteration 0:  Log likelihood = -1156.3988  
Iteration 1:  Log likelihood = -989.11738  
Iteration 2:  Log likelihood = -983.80139  
Iteration 3:  Log likelihood = -983.74219  
Iteration 4:  Log likelihood = -983.74202  
Iteration 5:  Log likelihood = -983.74202  

Refining starting values:

Grid node 0:  Log likelihood =          .
Grid node 1:  Log likelihood = -2365.6516
Grid node 2:  Log likelihood = -1322.8528
Grid node 3:  Log likelihood = -1081.1371

Fitting full model:

Iteration 0:  Log likelihood = -1081.1371  (not concave)
Iteration 1:  Log likelihood = -1007.9989  (not concave)
Iteration 2:  Log likelihood =  -985.2682  (not concave)
Iteration 3:  Log likelihood = -951.48326  
Iteration 4:  Log likelihood = -940.88085  
Iteration 5:  Log likelihood = -935.79247  
Iteration 6:  Log likelihood = -935.37925  
Iteration 7:  Log likelihood =  -935.3756  
Iteration 8:  Log likelihood = -935.37578  
Iteration 9:  Log likelihood = -935.37578  

Mixed-effects cloglog regression                Number of obs     =      4,760
Group variable: case                            Number of groups  =        115

                                                Obs per group:
                                                              min =          2
                                                              avg =       41.4
                                                              max =        127

Integration method: mvaghermite                 Integration pts.  =          7

                                                Wald chi2(10)     =      65.25
Log likelihood = -935.37578                     Prob > chi2       =     0.0000
----------------------------------------------------------------------------------
           y_any | Coefficient  Std. err.      z    P>|z|     [95% conf. interval]
-----------------+----------------------------------------------------------------
     1.postagree |   1.419953   .3081579     4.61   0.000     .8159743    2.023931
                 |
        rtype_cm |
   Satisfaction  |  -.1786478   .4244222    -0.42   0.674      -1.0105    .6532044
 Non-Repetition  |  -.5438558   .2580807    -2.11   0.035    -1.049685   -.0380268
Truth & Justice  |  -1.908352   .3352912    -5.69   0.000     -2.56551   -1.251193
   Compensation  |  -.4444884   .2818285    -1.58   0.115    -.9968622    .1078853
                 |
        art51pub |   .0663335   .2416203     0.27   0.784    -.4072335    .5399006
               t |    .012676   .1590721     0.08   0.936    -.2990996    .3244517
                 |
         c.t#c.t |  -.0086449   .0351078    -0.25   0.805    -.0774549    .0601652
                 |
     c.t#c.t#c.t |   .0012038   .0028494     0.42   0.673    -.0043809    .0067885
                 |
 c.t#c.t#c.t#c.t |  -.0000405    .000075    -0.54   0.589    -.0001875    .0001065
                 |
           _cons |  -2.560849   .2944993    -8.70   0.000    -3.138057   -1.983641
-----------------+----------------------------------------------------------------
case             |
       var(_cons)|   1.377893   .3416283                      .8475641    2.240054
----------------------------------------------------------------------------------
LR test vs. cloglog model: chibar2(01) = 96.73        Prob >= chibar2 = 0.0000

.    est store M34

.    
.  ** Table 3. Discrete-Time Duration Estimates
.   esttab M31 M32 M33 M34  /// 
>       using "Table_3.rtf", replace  b(%9.2f) se ///  
>               mtitles("IPW: Treatment" "IPW: Outcome" "IPW (after 2002)" "Unmatched") ///
>                   starlevels(* 0.05) nobase noomit label nodepvars  order(1.postagree) ///
>               title("Table 3. Discrete-Time Duration Models")  
(output written to Table_3.rtf)

.   
.   ** Figure 2. Expected Time to Compliance for Recommendations with and without Agreements
.    est restore M33
(results M33 are active now)

.    margins postagree, post

Predictive margins                                       Number of obs = 1,327
Model VCE: OIM

Expression: Marginal predicted mean, predict()

------------------------------------------------------------------------------
             |            Delta-method
             |     Margin   std. err.      z    P>|z|     [95% conf. interval]
-------------+----------------------------------------------------------------
   postagree |
          0  |   .1029655   .0231114     4.46   0.000     .0576681     .148263
          1  |   .2249123   .0494574     4.55   0.000     .1279775    .3218471
------------------------------------------------------------------------------

.    coefplot, transform(* = 1/(@b)) noci saving(ETC, replace) recast(dropline)  /// 
>      mlabel mlabsize(large) format(%3.0f) msymbol(|) xtitle("Years from art. 50 report to the first form of compliance (partial or full)", size(large))  ///
>      ylabel(1 "No agreement" 2 "After agreement" , labsize(large))      xsize(7) ysize(3) xlabel(0(5)15)          
file ETC.gph saved

. 
.   * Table 4. DiD
.   * Model 4.1. DiD 
.   reg y_any postagree agreement period , cluster(case)

Linear regression                               Number of obs     =      4,760
                                                F(3, 114)         =       8.93
                                                Prob > F          =     0.0000
                                                R-squared         =     0.0069
                                                Root MSE          =      .2294

                                 (Std. err. adjusted for 115 clusters in case)
------------------------------------------------------------------------------
             |               Robust
       y_any | Coefficient  std. err.      t    P>|t|     [95% conf. interval]
-------------+----------------------------------------------------------------
   postagree |   .0784942   .0240154     3.27   0.001     .0309199    .1260685
   agreement |   -.025527    .011531    -2.21   0.029    -.0483699   -.0026842
      period |   .0299519   .0096013     3.12   0.002     .0109318     .048972
       _cons |   .0254553   .0083276     3.06   0.003     .0089584    .0419522
------------------------------------------------------------------------------

.    est store M41

.   * Model 4.2. DiD with PSW 
.   reg y_any postagree agreement period [iweight = _weight], cluster(case)
(sum of wgt is 1,520)

Linear regression                               Number of obs     =      1,520
                                                F(3, 42)          =      10.41
                                                Prob > F          =     0.0000
                                                R-squared         =     0.0200
                                                Root MSE          =     .26868

                                  (Std. err. adjusted for 43 clusters in case)
------------------------------------------------------------------------------
             |               Robust
       y_any | Coefficient  std. err.      t    P>|t|     [95% conf. interval]
-------------+----------------------------------------------------------------
   postagree |   .0939599   .0301272     3.12   0.003     .0331607    .1547591
   agreement |  -.0457232   .0169205    -2.70   0.010    -.0798701   -.0115763
      period |   .0607971   .0139225     4.37   0.000     .0327003    .0888938
       _cons |   .0184707   .0098736     1.87   0.068    -.0014551    .0383965
------------------------------------------------------------------------------

.    est store M42 

.   * Model 4.3. DiD with adjustments  
.   reg y_any postagree agreement period rty_* art51pub c.t##c.t##c.t##c.t, cluster(case)

Linear regression                               Number of obs     =      4,760
                                                F(12, 114)        =       6.14
                                                Prob > F          =     0.0000
                                                R-squared         =     0.0259
                                                Root MSE          =     .22741

                                    (Std. err. adjusted for 115 clusters in case)
---------------------------------------------------------------------------------
                |               Robust
          y_any | Coefficient  std. err.      t    P>|t|     [95% conf. interval]
----------------+----------------------------------------------------------------
      postagree |   .1181395   .0257344     4.59   0.000     .0671599    .1691191
      agreement |  -.0541477   .0167834    -3.23   0.002    -.0873955   -.0208998
         period |   .0567288   .0168961     3.36   0.001     .0232577    .0901998
          rty_2 |   .0632255   .0378335     1.67   0.097    -.0117223    .1381734
          rty_3 |  -.0122016      .0183    -0.67   0.506    -.0484537    .0240505
          rty_4 |  -.0440553   .0178126    -2.47   0.015    -.0793419   -.0087686
          rty_5 |   .0082729   .0194154     0.43   0.671    -.0301889    .0467347
       art51pub |  -.0172288    .018624    -0.93   0.357    -.0541229    .0196653
              t |  -.0125265   .0112647    -1.11   0.268    -.0348417    .0097887
                |
        c.t#c.t |   .0007651   .0020684     0.37   0.712    -.0033323    .0048626
                |
    c.t#c.t#c.t |   1.27e-06   .0001445     0.01   0.993     -.000285    .0002876
                |
c.t#c.t#c.t#c.t |  -7.66e-07   3.30e-06    -0.23   0.817    -7.31e-06    5.78e-06
                |
          _cons |   .0665048   .0238382     2.79   0.006     .0192816     .113728
---------------------------------------------------------------------------------

.    est store M43

.      konfound postagree
------------------
% Bias Necessary to Invalidate/Sustain the Inference

For postagree:
To invalidate the inference 57.30% of the estimate would have to be due to bias; to invalidate the
inference 57.30% (2727) cases would have to be replaced with cases for which there is an effect of 0.
------------------
Impact Threshold for an Omitted Confounding Variable

For postagree:
An omitted variable would have to be correlated at 0.198 with the outcome and at 0.198 with the predictor
of interest (conditioning on observed covariates) to invalidate an inference. 
Correspondingly the minimum impact to invalidate an inference for a
null hypothesis of 0 effect is 0.198 x 0.198=0.0392

These thresholds can be compared with the impacts of observed covariates below.

Observed Impact Table for postagree

+--------------------------------------------------+
|              |    Cor(v, |    Cor(v, |           |
|   Zero-Order |        X) |        Y) |    Impact |
|--------------+-----------+-----------+-----------|
|    agreement |     .8079 |     .0404 |     .0326 |
|       period |     .0984 |     .0473 |     .0047 |
|        rty_2 |     .0038 |      .056 |     .0002 |
|        rty_3 |    -.0257 |      .011 |    -.0003 |
|     art51pub |     .0366 |    -.0526 |    -.0019 |
|        rty_5 |    -.0495 |     .0396 |     -.002 |
|            t |     .0928 |     -.055 |    -.0051 |
|        rty_4 |     .0873 |    -.0826 |    -.0072 |
+--------------------------------------------------+

+--------------------------------------------------+
|              |    Cor(v, |    Cor(v, |           |
|   Partialled |        X) |        Y) |    Impact |
|--------------+-----------+-----------+-----------|
|    agreement |     .8193 |     .0384 |     .0315 |
|       period |     .0933 |     .0637 |     .0059 |
|        rty_4 |    -.0082 |    -.0488 |     .0004 |
|        rty_3 |    -.0104 |     -.015 |     .0002 |
|        rty_5 |    -.0539 |     .0029 |    -.0002 |
|        rty_2 |    -.0324 |     .0321 |     -.001 |
|            t |     .1032 |    -.0384 |     -.004 |
|     art51pub |     .1215 |    -.0349 |    -.0042 |
+--------------------------------------------------+

X represents postagree, Y represents y_any, v represents each covariate.
The first table is based on unconditional correlations. The second table is based on partialled correlations.

.   * Model 4.4. DiD with adjustments and PSW
.   reg y_any postagree agreement period rty_* art51pub c.t##c.t##c.t##c.t [iweight = _weight], cluster(case)
(sum of wgt is 1,520)

Linear regression                               Number of obs     =      1,520
                                                F(12, 42)         =       6.22
                                                Prob > F          =     0.0000
                                                R-squared         =     0.0778
                                                Root MSE          =     .26141

                                     (Std. err. adjusted for 43 clusters in case)
---------------------------------------------------------------------------------
                |               Robust
          y_any | Coefficient  std. err.      t    P>|t|     [95% conf. interval]
----------------+----------------------------------------------------------------
      postagree |   .1218651   .0358531     3.40   0.001     .0495106    .1942197
      agreement |  -.0872884   .0293162    -2.98   0.005    -.1464509   -.0281259
         period |    .110657   .0309006     3.58   0.001     .0482971    .1730168
          rty_2 |  -.1524492   .1396436    -1.09   0.281    -.4342614     .129363
          rty_3 |  -.1623354   .1311504    -1.24   0.223    -.4270077    .1023368
          rty_4 |  -.2061483   .1304061    -1.58   0.121    -.4693184    .0570219
          rty_5 |  -.1259405   .1296573    -0.97   0.337    -.3875995    .1357184
       art51pub |   .0417467    .043165     0.97   0.339    -.0453637    .1288572
              t |  -.0360806   .0258116    -1.40   0.170    -.0881706    .0160094
                |
        c.t#c.t |   .0033205   .0046168     0.72   0.476    -.0059964    .0126375
                |
    c.t#c.t#c.t |  -.0001392   .0003149    -0.44   0.661    -.0007747    .0004962
                |
c.t#c.t#c.t#c.t |   2.12e-06   6.99e-06     0.30   0.763     -.000012    .0000162
                |
          _cons |   .2149965    .132981     1.62   0.113      -.05337     .483363
---------------------------------------------------------------------------------

.    est store M44

.      konfound postagree
------------------
% Bias Necessary to Invalidate/Sustain the Inference

For postagree:
To invalidate the inference 42.29% of the estimate would have to be due to bias; to invalidate the
inference 42.29% (643) cases would have to be replaced with cases for which there is an effect of 0.
------------------
Impact Threshold for an Omitted Confounding Variable

For postagree:
An omitted variable would have to be correlated at 0.197 with the outcome and at 0.197 with the predictor
of interest (conditioning on observed covariates) to invalidate an inference. 
Correspondingly the minimum impact to invalidate an inference for a
null hypothesis of 0 effect is 0.197 x 0.197=0.0387

These thresholds can be compared with the impacts of observed covariates below.

Observed Impact Table for postagree

+--------------------------------------------------+
|              |    Cor(v, |    Cor(v, |           |
|   Zero-Order |        X) |        Y) |    Impact |
|--------------+-----------+-----------+-----------|
|       period |     .2302 |     .1054 |     .0243 |
|        rty_3 |     .2069 |     .0467 |     .0097 |
|    agreement |     .7527 |     .0012 |     .0009 |
|        rty_4 |     .0006 |    -.1448 |    -.0001 |
|        rty_2 |    -.0205 |     .0613 |    -.0013 |
|        rty_5 |    -.2094 |     .0443 |    -.0093 |
|     art51pub |     .1886 |    -.0665 |    -.0125 |
|            t |     .1467 |    -.0944 |    -.0138 |
+--------------------------------------------------+

+--------------------------------------------------+
|              |    Cor(v, |    Cor(v, |           |
|   Partialled |        X) |        Y) |    Impact |
|--------------+-----------+-----------+-----------|
|       period |     .1418 |     .1331 |     .0189 |
|        rty_4 |    -.0724 |    -.1023 |     .0074 |
|        rty_5 |    -.1065 |    -.0588 |     .0063 |
|        rty_3 |    -.0401 |    -.0575 |     .0023 |
|        rty_2 |    -.0767 |    -.0148 |     .0011 |
|     art51pub |     .2003 |    -.0118 |    -.0024 |
|            t |     .1608 |    -.0893 |    -.0144 |
|    agreement |     .7657 |    -.0323 |    -.0247 |
+--------------------------------------------------+

X represents postagree, Y represents y_any, v represents each covariate.
The first table is based on unconditional correlations. The second table is based on partialled correlations.

.    
.   ** Table 4. Discrete-Time Duration Estimates 
.   esttab M41 M42 M43 M44 /// 
>       using "Table_4.rtf", replace  b(%9.2f) se ///  
>               mtitles("DiD" "DiD with PSW" "DiD with adjustments" "PSW and adjustments") ///
>                   starlevels(* 0.05) nobase noomit label nodepvars  ///
>               title("Table 4. Difference-in-Differences Models")                
(output written to Table_4.rtf)

.           
.  * Estimate with heterogeneous period effects
.   est restore M41
(results M41 are active now)

.    global bany1 = _b[postagree]

.   csdid y_any , time(year) gvar(agreement_yr) agg(simple) cluster(case)
xxx.....................xx......................xx
xx....................xxxxxxxxx...............xxxx
xxxxxx..............xxxxxxxxxxxxxxx....xxxxxxxxxxx
xxxxxxxx..........xxxxxxxxxxxxxxxxxx......xxxxxxxx
xxxxxxxxxx......
Difference-in-difference with Multiple Time Periods

                                                         Number of obs = 4,742
Outcome model  : regression adjustment
Treatment model: none
                                 (Std. err. adjusted for 115 clusters in case)
------------------------------------------------------------------------------
             | Coefficient  Std. err.      z    P>|z|     [95% conf. interval]
-------------+----------------------------------------------------------------
         ATT |   .0727063   .0257791     2.82   0.005     .0221803    .1232323
------------------------------------------------------------------------------
Control: Never Treated

See Callaway and Sant'Anna (2021) for details

.     global bany1h = _b[ATT]

.    * How much does the estimate for DiD change if we allow for heterogeneity?
.         di 100*($bany1h-$bany1)/$bany1
-7.3736675

.   est restore M42        
(results M42 are active now)

.     global bany2 = _b[postagree]

.   csdid y_any [iweight = _weight], time(year) gvar(agreement_yr) agg(simple) cluster(cowcode)
xxx.....................xx......................xx
xx....................xxxxxxxxx...............xxxx
xxxxxx..............xxxxxxxxxxxxxxx....xxxxxxxxxxx
xxxxxxxx..........xxxxxxxxxxxxxxxxxx......xxxxxxxx
xxxxxxxxxx......(3,240 missing values generated)

Difference-in-difference with Multiple Time Periods

                                                         Number of obs = 1,510
Outcome model  : regression adjustment
Treatment model: none
                                (Std. err. adjusted for 9 clusters in cowcode)
------------------------------------------------------------------------------
             | Coefficient  Std. err.      z    P>|z|     [95% conf. interval]
-------------+----------------------------------------------------------------
         ATT |   .0451202   .0208053     2.17   0.030     .0043425    .0858979
------------------------------------------------------------------------------
Control: Never Treated

See Callaway and Sant'Anna (2021) for details

.     global bany2h = _b[ATT]

.         di 100*($bany2h-$bany2)/$bany2
-51.979295

. 
. log close
      name:  <unnamed>
       log:  G:\Shared drives\NDRL_IACHR_Acuerdos\Paper\Article\ISQ\Replication\ndrl_agreements.log
  log type:  text
 closed on:  19 Oct 2023, 10:34:07
---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
